package adv5;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

/**
 * @author oldliu
 * @since 1.0
 */
public class FileRead {
    public static void main(String[] args) {
        File f=new File("javaAdvance/src/adv5/FilePath.java");
        byte b[]=new byte[30];
        try {
            FileInputStream fin=new FileInputStream(f);
            int len=0;
            //len代表实际读取的长度
            while ((len= fin.read(b))!=-1){
                System.out.print(new String(b,0,len));
            }

            fin.close();//?
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
